﻿using System;
using System.Data;
using System.Data.Common;
using Liger.Common;
using Liger.Data;

namespace EasyFMS.Model
{

	/// <summary>
	/// 实体类vMetaData
	/// </summary>
	[Serializable]
	public class vMetaData : Entity 
	{ 
		 public vMetaData() 
            : base("vMetaData") 
        { 

        }


		#region Model
		private int _UID;
		private string _Code;
		private string _Name;
		private string _TSQL;
		private string _FieldCode;
		private string _FieldName;
		private string _FieldWidth;
		private string _FieldFind;
		private string _FieldExport;
		private bool? _IsSelect;
		private int? _UserCreateID;
		private string _CreateDate;
		private int? _UserModifyID;
		private string _ModifyDate;
		private string _UserCreate;
		private string _UserModify;
	 
		/// <summary>
		/// 
		/// </summary>
		public int UID
		{
			get{ return _UID; }
			set
			{
				this.OnPropertyValueChange(_.UID,_UID,value);
				this._UID = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string Code
		{
			get{ return _Code; }
			set
			{
				this.OnPropertyValueChange(_.Code,_Code,value);
				this._Code = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string Name
		{
			get{ return _Name; }
			set
			{
				this.OnPropertyValueChange(_.Name,_Name,value);
				this._Name = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string TSQL
		{
			get{ return _TSQL; }
			set
			{
				this.OnPropertyValueChange(_.TSQL,_TSQL,value);
				this._TSQL = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string FieldCode
		{
			get{ return _FieldCode; }
			set
			{
				this.OnPropertyValueChange(_.FieldCode,_FieldCode,value);
				this._FieldCode = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string FieldName
		{
			get{ return _FieldName; }
			set
			{
				this.OnPropertyValueChange(_.FieldName,_FieldName,value);
				this._FieldName = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string FieldWidth
		{
			get{ return _FieldWidth; }
			set
			{
				this.OnPropertyValueChange(_.FieldWidth,_FieldWidth,value);
				this._FieldWidth = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string FieldFind
		{
			get{ return _FieldFind; }
			set
			{
				this.OnPropertyValueChange(_.FieldFind,_FieldFind,value);
				this._FieldFind = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string FieldExport
		{
			get{ return _FieldExport; }
			set
			{
				this.OnPropertyValueChange(_.FieldExport,_FieldExport,value);
				this._FieldExport = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public bool? IsSelect
		{
			get{ return _IsSelect; }
			set
			{
				this.OnPropertyValueChange(_.IsSelect,_IsSelect,value);
				this._IsSelect = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? UserCreateID
		{
			get{ return _UserCreateID; }
			set
			{
				this.OnPropertyValueChange(_.UserCreateID,_UserCreateID,value);
				this._UserCreateID = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string CreateDate
		{
			get{ return _CreateDate; }
			set
			{
				this.OnPropertyValueChange(_.CreateDate,_CreateDate,value);
				this._CreateDate = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? UserModifyID
		{
			get{ return _UserModifyID; }
			set
			{
				this.OnPropertyValueChange(_.UserModifyID,_UserModifyID,value);
				this._UserModifyID = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string ModifyDate
		{
			get{ return _ModifyDate; }
			set
			{
				this.OnPropertyValueChange(_.ModifyDate,_ModifyDate,value);
				this._ModifyDate = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string UserCreate
		{
			get{ return _UserCreate; }
			set
			{
				this.OnPropertyValueChange(_.UserCreate,_UserCreate,value);
				this._UserCreate = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string UserModify
		{
			get{ return _UserModify; }
			set
			{
				this.OnPropertyValueChange(_.UserModify,_UserModify,value);
				this._UserModify = value;
			}
		}
		#endregion

		#region Method
		/// <summary>
		/// 获取列信息
		/// </summary>
		public override Field[] GetFields()
		{
			return new Field[] {
				_.UID,
				_.Code,
				_.Name,
				_.TSQL,
				_.FieldCode,
				_.FieldName,
				_.FieldWidth,
				_.FieldFind,
				_.FieldExport,
				_.IsSelect,
				_.UserCreateID,
				_.CreateDate,
				_.UserModifyID,
				_.ModifyDate,
				_.UserCreate,
				_.UserModify
			};
		}
		/// <summary>
		/// 获取值信息
		/// </summary>
		public override object[] GetValues()
		{
			return new object[] {
				_UID,
				_Code,
				_Name,
				_TSQL,
				_FieldCode,
				_FieldName,
				_FieldWidth,
				_FieldFind,
				_FieldExport,
				_IsSelect,
				_UserCreateID,
				_CreateDate,
				_UserModifyID,
				_ModifyDate,
				_UserCreate,
				_UserModify
			};
		} 
		/// <summary>
		/// 设置字段值
		/// </summary>
		public override void SetValue(string fieldName, object value)
        {
            switch (fieldName)
            { 
				case "UID":
                    this._UID = DataHelper.ConvertValue<int>(value);
                    break; 
				case "Code":
                    this._Code = DataHelper.ConvertValue<string>(value);
                    break; 
				case "Name":
                    this._Name = DataHelper.ConvertValue<string>(value);
                    break; 
				case "TSQL":
                    this._TSQL = DataHelper.ConvertValue<string>(value);
                    break; 
				case "FieldCode":
                    this._FieldCode = DataHelper.ConvertValue<string>(value);
                    break; 
				case "FieldName":
                    this._FieldName = DataHelper.ConvertValue<string>(value);
                    break; 
				case "FieldWidth":
                    this._FieldWidth = DataHelper.ConvertValue<string>(value);
                    break; 
				case "FieldFind":
                    this._FieldFind = DataHelper.ConvertValue<string>(value);
                    break; 
				case "FieldExport":
                    this._FieldExport = DataHelper.ConvertValue<string>(value);
                    break; 
				case "IsSelect":
                    this._IsSelect = DataHelper.ConvertValue<bool?>(value);
                    break; 
				case "UserCreateID":
                    this._UserCreateID = DataHelper.ConvertValue<int?>(value);
                    break; 
				case "CreateDate":
                    this._CreateDate = DataHelper.ConvertValue<string>(value);
                    break; 
				case "UserModifyID":
                    this._UserModifyID = DataHelper.ConvertValue<int?>(value);
                    break; 
				case "ModifyDate":
                    this._ModifyDate = DataHelper.ConvertValue<string>(value);
                    break; 
				case "UserCreate":
                    this._UserCreate = DataHelper.ConvertValue<string>(value);
                    break; 
				case "UserModify":
                    this._UserModify = DataHelper.ConvertValue<string>(value);
                    break; 
            }
        }
		/// <summary>
		/// 获取字段值
		/// </summary>
        public override object GetValue(string fieldName)
        {
            switch (fieldName)
            { 
				case "UID":
                    return this._UID; 
				case "Code":
                    return this._Code; 
				case "Name":
                    return this._Name; 
				case "TSQL":
                    return this._TSQL; 
				case "FieldCode":
                    return this._FieldCode; 
				case "FieldName":
                    return this._FieldName; 
				case "FieldWidth":
                    return this._FieldWidth; 
				case "FieldFind":
                    return this._FieldFind; 
				case "FieldExport":
                    return this._FieldExport; 
				case "IsSelect":
                    return this._IsSelect; 
				case "UserCreateID":
                    return this._UserCreateID; 
				case "CreateDate":
                    return this._CreateDate; 
				case "UserModifyID":
                    return this._UserModifyID; 
				case "ModifyDate":
                    return this._ModifyDate; 
				case "UserCreate":
                    return this._UserCreate; 
				case "UserModify":
                    return this._UserModify; 
				default :
                    return null;
            } 
        }



		#endregion

		#region _Field
		/// <summary>
		/// 字段信息
		/// </summary>
		public class _
		{
			/// <summary>
			/// * 
			/// </summary>
			public readonly static Field All = new Field("*","vMetaData");
 
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field UID = new Field("UID","vMetaData","UID");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field Code = new Field("Code","vMetaData","Code");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field Name = new Field("Name","vMetaData","Name");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field TSQL = new Field("TSQL","vMetaData","TSQL");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field FieldCode = new Field("FieldCode","vMetaData","FieldCode");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field FieldName = new Field("FieldName","vMetaData","FieldName");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field FieldWidth = new Field("FieldWidth","vMetaData","FieldWidth");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field FieldFind = new Field("FieldFind","vMetaData","FieldFind");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field FieldExport = new Field("FieldExport","vMetaData","FieldExport");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field IsSelect = new Field("IsSelect","vMetaData","IsSelect");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field UserCreateID = new Field("UserCreateID","vMetaData","UserCreateID");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field CreateDate = new Field("CreateDate","vMetaData","CreateDate");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field UserModifyID = new Field("UserModifyID","vMetaData","UserModifyID");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field ModifyDate = new Field("ModifyDate","vMetaData","ModifyDate");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field UserCreate = new Field("UserCreate","vMetaData","UserCreate");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field UserModify = new Field("UserModify","vMetaData","UserModify");
		}
		#endregion

 
	}
}

